package com.wilmer.testRecordDetails.service.impl;

import java.util.List;
import com.wilmer.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wilmer.testRecordDetails.mapper.YwTestRecordsDetailsMapper;
import com.wilmer.testRecordDetails.domain.YwTestRecordsDetails;
import com.wilmer.testRecordDetails.service.IYwTestRecordsDetailsService;

/**
 * 随堂测试记录详细Service业务层处理
 * 
 * @author zl
 * @date 2024-04-11
 */
@Service
public class YwTestRecordsDetailsServiceImpl implements IYwTestRecordsDetailsService 
{
    @Autowired
    private YwTestRecordsDetailsMapper ywTestRecordsDetailsMapper;

    /**
     * 查询随堂测试记录详细
     * 
     * @param recordDetailsId 随堂测试记录详细主键
     * @return 随堂测试记录详细
     */
    @Override
    public YwTestRecordsDetails selectYwTestRecordsDetailsByRecordDetailsId(Long recordDetailsId)
    {
        return ywTestRecordsDetailsMapper.selectYwTestRecordsDetailsByRecordDetailsId(recordDetailsId);
    }

    /**
     * 查询随堂测试记录详细列表
     * 
     * @param ywTestRecordsDetails 随堂测试记录详细
     * @return 随堂测试记录详细
     */
    @Override
    public List<YwTestRecordsDetails> selectYwTestRecordsDetailsList(YwTestRecordsDetails ywTestRecordsDetails)
    {
        return ywTestRecordsDetailsMapper.selectYwTestRecordsDetailsList(ywTestRecordsDetails);
    }

    /**
     * 新增随堂测试记录详细
     * 
     * @param ywTestRecordsDetails 随堂测试记录详细
     * @return 结果
     */
    @Override
    public int insertYwTestRecordsDetails(YwTestRecordsDetails ywTestRecordsDetails)
    {
        ywTestRecordsDetails.setCreateTime(DateUtils.getNowDate());
        return ywTestRecordsDetailsMapper.insertYwTestRecordsDetails(ywTestRecordsDetails);
    }

    /**
     * 修改随堂测试记录详细
     * 
     * @param ywTestRecordsDetails 随堂测试记录详细
     * @return 结果
     */
    @Override
    public int updateYwTestRecordsDetails(YwTestRecordsDetails ywTestRecordsDetails)
    {
        ywTestRecordsDetails.setUpdateTime(DateUtils.getNowDate());
        return ywTestRecordsDetailsMapper.updateYwTestRecordsDetails(ywTestRecordsDetails);
    }

    /**
     * 批量删除随堂测试记录详细
     * 
     * @param recordDetailsIds 需要删除的随堂测试记录详细主键
     * @return 结果
     */
    @Override
    public int deleteYwTestRecordsDetailsByRecordDetailsIds(Long[] recordDetailsIds)
    {
        return ywTestRecordsDetailsMapper.deleteYwTestRecordsDetailsByRecordDetailsIds(recordDetailsIds);
    }

    /**
     * 删除随堂测试记录详细信息
     * 
     * @param recordDetailsId 随堂测试记录详细主键
     * @return 结果
     */
    @Override
    public int deleteYwTestRecordsDetailsByRecordDetailsId(Long recordDetailsId)
    {
        return ywTestRecordsDetailsMapper.deleteYwTestRecordsDetailsByRecordDetailsId(recordDetailsId);
    }
}
